import { RootState } from 'app/store/store';
export const addPresetPrompt = (state: RootState) => {
  const {
    selectedArtist,
    selectedArtisticEffect,
    selectedArtisticStyle,
    selectedPaintingStyle,
    presetMap,
  } = state.preset;

  let presetPrompt = '';
  try {
    presetPrompt = [
      ...selectedArtist.map((id) => presetMap.artist[id].englishDesc),
      ...selectedArtisticEffect.map(
        (id) => presetMap.artisticEffect[id].englishDesc
      ),
      ...selectedArtisticStyle.map(
        (id) => presetMap.artisticStyle[id].englishDesc
      ),
      ...selectedPaintingStyle.map(
        (id) => presetMap.paintingStyle[id].englishDesc
      ),
    ].join(',');
    presetPrompt = `,${presetPrompt}`;
  } catch (error) {
    console.log(error);
  }

  return presetPrompt;
};
